package com.cidp.system.dao.impl;

import com.cidp.system.dao.ISystemInfoDao;
import com.cidp.system.model.Tsysteminfo;
import com.cidp.system.pojo.SysteminfoPo;
import com.litt.core.dao.BaseDaoImpl;
import com.litt.core.page.IPageList;
import com.litt.core.page.PagePoParam;

/**
 * <b>标题：</b>系统配置管理DAO实现.
 * 
 * <pre>
 * &lt;b&gt;描述&lt;/b&gt;
 *    系统配置管理
 * </pre>
 * 
 * @author lijian
 * @since 2008-5-23
 * @version 1.0
 */
public class SystemInfoDaoImpl extends BaseDaoImpl implements ISystemInfoDao {
	/**
	 * 读取系统配置信息
	 * 
	 * @param sysId 系统配置ID
	 * @return Tsysteminfo对象
	 */
	public Tsysteminfo loadById(Long sysId) {
		return (Tsysteminfo) super.loadObject(Tsysteminfo.class, sysId);
	}

	/**
	 * 删除系统配置信息.
	 * 
	 * @param systeminfo 系统配置对象
	 */
	public void deleteSystemInfo(Tsysteminfo systeminfo) {
		super.deleteObject(systeminfo);
	}

	/**
	 * 保存系统配置信息.
	 * 
	 * @param systeminfo 系统配置对象
	 */
	public void saveSystemInfo(Tsysteminfo systeminfo) {
		super.saveObject(systeminfo);
	}

	/**
	 * 更新系统配置信息.
	 * 
	 * @param systeminfo 系统配置对象
	 */
	public void updateSystemInfo(Tsysteminfo systeminfo) {
		super.updateObject(systeminfo);
	}
	
	/**
	 * 分页查询系统信息信息.
	 * 
	 * @param pagePoParam 查询参数
	 * @return IPageList IPageList对象
	 */
	public IPageList listByPage(PagePoParam pagePoParam) {
		SysteminfoPo systemInfoPo = (SysteminfoPo) pagePoParam.getConds();
		StringBuffer listHql = new StringBuffer("from Tsysteminfo where 1=1");
		StringBuffer listCountHql = new StringBuffer("select count(*) from Tsysteminfo where 1=1");
		
		return super.listHqlPage(listHql.toString(), listCountHql.toString(),pagePoParam.getPageIndex(), pagePoParam.getPageSize());
	}
	
	/**
	 * 读取系统配置信息
	 * 
	 * @return Tsysteminfo对象
	 */
	public Tsysteminfo getTsysteminfo() {
		String hql = " from Tsysteminfo ";
		return (Tsysteminfo) super.uniqueResultHql(hql);
	}
}
